﻿@model List<KRM.Core.CustomerSearchView>
@{
    ViewBag.Title = "Assign Customers to Vouchers";
    Layout = "/Views/Shared/_PopupLayout.cshtml";
}
<div class="padding10">
    <form action="/voucher/searchcustomer" method="POST" id="SearchVoucherCustomers">
        <div class="row-fluid" >
            <div class="span3">
                <fieldset> 
                    <legend>Websites</legend>
                    <div class="row-fluid"style="max-height: 180px;overflow-y: scroll;">
                        @foreach (var item in ViewBag.lstStores)
                        {
                            <label>
                                <input type="checkbox" name="SelectedStores" value="@item.StoreID"style="float:left;margin-right: 5px;"/>
                                @item.StoreName
                            </label>
                        }
                    </div>
                </fieldset> 
            </div>
            <div class="span2">
                <fieldset> 
                    <legend>Order Date</legend>
                    <div class="row-fluid">
                        <label>
                            <input type="radio" name="SearchByOrderDate" value="false"style="float:left;" checked="checked"/>
                            Not Specified
                        </label>             
                        <label>
                            <input type="radio" name="SearchByOrderDate" value="true"style="float:left;"/>
                            Dates
                        </label>
                        <div class="row-fluid">
                            <label class="control-label">From: </label>
                            <div id="datetimepicker2" class="input-append">
                                <input data-format="MM/dd/yyyy" type="text" style="width: 70%" name="OrderDateFrom"  value="@DateTime.Now.ToString("MM/dd/yyyy")" required="required">
                                <span class="add-on">
                                    <i data-time-icon="icon-time" data-date-icon="icon-calendar" class="icon-calendar"></i>
                                </span>
                            </div>
                        </div>
                        <div class="row-fluid">
                            <label class="control-label">To: </label>
                            <div id="datetimepicker3" class="input-append">
                                <input data-format="MM/dd/yyyy" type="text" style="width: 70%" name="OrderDateTo"  value="@DateTime.Now.ToString("MM/dd/yyyy")" required="required">
                                <span class="add-on">
                                    <i data-time-icon="icon-time" data-date-icon="icon-calendar" class="icon-calendar"></i>
                                </span>
                            </div>
                        </div>
                    </div>
                </fieldset> 
            </div>
            <div class="span3">
                <div class="row-fluid">
                    <fieldset> 
                        <legend>Order Amount</legend>
                        <div class="row-fluid ">
                            <div class="row-fluid ">
                                <div class="span4">
                                    <label class="control-label"><input type="checkbox" name="SearchByMinAmount" value="true" style="vertical-align: middle;"/>
                                        <span style="vertical-align: middle;">Min &pound;</span>
                                    </label>
                                </div>
                                <div class="span8">
                                    <input type="text" style="width: 90%" name="MinAmount" value=""/>
                                </div></div>
                            <div class="row-fluid ">
                                <div class="span4">
                                    <label class="control-label"><input type="checkbox" name="SearchByMaxAmount" value="true" style="vertical-align: middle;"/>
                                        <span style="vertical-align: middle;">Max &pound;</span> 
                                    </label> 
                                </div>
                                <div class="span8">
                                    <input type="text" style="width: 90%" name="MaxAmount" value=""/>
                                </div>
                            </div>
                        </div>

                    </fieldset> 
                </div>
                <div class="row-fluid">
                    <fieldset> 
                        <legend>Email</legend>
                        <div class="row-fluid">
                            <input type="text" name="CustomerEmail" style="width:95%"/>
                        </div>
                    </fieldset> 
                </div>
            </div>
            <div class="span2"><div class="row-fluid">
                                   <fieldset> 
                                       <legend>Order Type</legend>
                                       <div class="row-fluid" >
                                           <select name="OrderType" style="width: 100%">
                                               <option value="All">All</option>
                                               <option value="Phone">Phone</option>
                                               <option value="Web">Web</option>
                                               <option value="Google">Google</option>
                                           </select>
                                       </div>
                                   </fieldset> 
                               </div>
    
                <div class="row-fluid">
                    <fieldset> 
                        <legend>Receive News Letter</legend>
                        <div class="row-fluid">
                            <select name="NewsLetter" style="width: 100%">
                                <option value="All">All</option>
                                <option value="SignedUp">Signed Up</option>
                                <option value="NotSignedUp">Not Signed Up</option>
                            </select>
                        </div>
                    </fieldset> 
                </div> </div>

            <div class="span2">
                <fieldset> 
                    <legend>Product Range</legend>
                    <div class="row-fluid">
                        <div class="row-fluid">
                            <label>
                                <input type="radio" name="SearchByProductRange" value="None"style="float:left;" checked="checked"/>
                                Not Specified 
                            </label></div>
                        <div class="row-fluid">
                            <label>
                                <input type="radio" name="SearchByProductRange" value="Product"style="float:left;"/>
                                Product Id
                        
                            </label> </div>
                        <div class="row-fluid">
                            <input type="text" name="ProductId"style="width: 90%"/>
                            <label>
                                <input type="radio" name="SearchByProductRange" value="Department"style="float:left;"/>
                                Department Id
                            </label>
                            <input type="text" name="DepartmentId"style="width: 90%"/>
                        </div>
                    </div>
                </fieldset> 
            </div>
        </div>
        <div class="row-fluid">
              <fieldset> 
                    <legend>Search Customer</legend>
            <div class="span5"><label class="control-label">
                                   Total Record Display:
                                   <select name="TotalRecordDisplay" id="TotalRecordDisplay">
                                       <option value="10">10</option>
                                       <option value="50">50</option>
                                       <option value="100">100</option>
                                       <option value="200">200</option>
                                       <option value="500">500</option>
                                       <option value="1000">1000</option>
                                       <option value="0">All</option>
                                   </select>
                               </label>
            </div>
            <div class="span4">
                <button type="submit" class="btn btn-primary">Display Customers</button>
                <button type="reset" class="btn " onclick="searchCustomerCNO()">Display CNO</button>
                <button type="reset" class="btn ">Clear</button>
            </div></fieldset> 
        </div>
    </form>
        <fieldset> 
            <legend>Search Result</legend>
           <div class="row-fluid" style="padding-bottom: 5px;">
           <div class="span3">
               <button type="button" class="btn btn-primary" onclick="addCustomersToVoucher()">Add Selected Customers</button>
           </div>
           
            <div class="span6">
                <label class="checkbox">
                    <input type="checkbox" name="SendEmail" value="True" /> Send email to new customers?
                </label>
            </div></div>
            <form action="Voucher/AddCustomersToVoucher"  method="POST"id="frSearchCustomerResult">
                <input type="hidden" name="VoucherId" value="@ViewBag.VoucherId"/>
                <div class="row-fluid" id="SearchCustomerResult">
                    @Html.Partial("_SearchCustomerResult")
                </div>
            </form>
        </fieldset> 

</div>
